package com.cskaoyan.javase.basic._7operator._0arithmetic;

/**
 * @description: 算术运算符
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

public class Demo {
    public static void main(String[] args) {
        //自增自减符号
        /*int a = 10;
        int b = 10;
        int c = 10;
        a = b++; //a=10,b=11,c=10
        c = --a;//a=9,b=11,c=9
        b = ++a;//a=10,b=10,c=9
        a = c--;//a=9,b=10,c=8
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);*/

        /*int x = 4;
        int y = (x++) + (++x) + (x * 10);
        System.out.println(y); //4 + 6 + 60 = 70

        //自增自减在开发中最常见的地方还是在循环中,比如for循环
        //如果你不是为了出面试题，不要在开发中这样使用自增自减
        for (int i = 0; i < 10; i++) {

        }*/

        int a = 1;
        a = a++;
        System.out.println(a); //1

    }
}
